home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / d3d.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  46.2 KB  |  892 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (c) 1995-1998 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:   d3d.h
  6.  *  Content:    Direct3D include file
  7.  *
  8.  ***************************************************************************/
  9. #ifndef _D3D_H_
  10. #define _D3D_H_
  11.  
  12. #include <stdlib.h>
  13.  
  14. #ifdef _WIN32
  15. #define COM_NO_WINDOWS_H
  16. #include <objbase.h>
  17. #else
  18. #include "d3dcom.h"
  19. #endif
  20.  
  21. #ifdef _WIN32
  22. #define D3DAPI WINAPI
  23. #else
  24. #define D3DAPI
  25. #endif
  26.  
  27. /*
  28.  * Interface IID's
  29.  */
  30. DEFINE_GUID( IID_IDirect3D,             0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  31. DEFINE_GUID( IID_IDirect3D2,            0x6aae1ec1,0x662a,0x11d0,0x88,0x9d,0x00,0xaa,0x00,0xbb,0xb7,0x6a );
  32.  
  33. //DEFINE_GUID( IID_IDirect3DRampDevice,   0xF2086B20,0x259F,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  34. DEFINE_GUID( IID_IDirect3DRGBDevice,    0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  35. DEFINE_GUID( IID_IDirect3DHALDevice,    0x84E63dE0,0x46AA,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  36.  
  37. DEFINE_GUID( IID_IDirect3DDevice,       0x64108800,0x957d,0X11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
  38. DEFINE_GUID( IID_IDirect3DDevice2,      0x93281501,0x8cf8,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
  39. DEFINE_GUID( IID_IDirect3DTexture,      0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  40. DEFINE_GUID( IID_IDirect3DTexture2,     0x93281502,0x8cf8,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
  41. DEFINE_GUID( IID_IDirect3DLight,        0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  42. DEFINE_GUID( IID_IDirect3DMaterial,     0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  43. DEFINE_GUID( IID_IDirect3DMaterial2,    0x93281503,0x8cf8,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
  44. DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  45. DEFINE_GUID( IID_IDirect3DViewport,     0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );
  46. DEFINE_GUID( IID_IDirect3DViewport2,    0x93281500,0x8cf8,0x11d0,0x89,0xab,0x00,0xa0,0xc9,0x05,0x41,0x29 );
  47.  
  48. /*
  49.  * Data structures
  50.  */
  51. #ifdef __cplusplus
  52.  
  53. /* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */
  54. struct IDirect3D;
  55. struct IDirect3D2;
  56. struct IDirect3DDevice;
  57. struct IDirect3DDevice2;
  58. struct IDirect3DExecuteBuffer;
  59. struct IDirect3DLight;
  60. struct IDirect3DMaterial;
  61. struct IDirect3DMaterial2;
  62. struct IDirect3DTexture;
  63. struct IDirect3DTexture2;
  64. struct IDirect3DViewport;
  65. struct IDirect3DViewport2;
  66. typedef struct IDirect3D        *LPDIRECT3D;
  67. typedef struct IDirect3D2       *LPDIRECT3D2;
  68. typedef struct IDirect3DDevice      *LPDIRECT3DDEVICE;
  69. typedef struct IDirect3DDevice2     *LPDIRECT3DDEVICE2;
  70. typedef struct IDirect3DExecuteBuffer   *LPDIRECT3DEXECUTEBUFFER;
  71. typedef struct IDirect3DLight       *LPDIRECT3DLIGHT;
  72. typedef struct IDirect3DMaterial    *LPDIRECT3DMATERIAL;
  73. typedef struct IDirect3DMaterial2   *LPDIRECT3DMATERIAL2;
  74. typedef struct IDirect3DTexture     *LPDIRECT3DTEXTURE;
  75. typedef struct IDirect3DTexture2        *LPDIRECT3DTEXTURE2;
  76. typedef struct IDirect3DViewport    *LPDIRECT3DVIEWPORT;
  77. typedef struct IDirect3DViewport2   *LPDIRECT3DVIEWPORT2;
  78.  
  79. #else
  80.  
  81. typedef struct IDirect3D        *LPDIRECT3D;
  82. typedef struct IDirect3D2       *LPDIRECT3D2;
  83. typedef struct IDirect3DDevice      *LPDIRECT3DDEVICE;
  84. typedef struct IDirect3DDevice2     *LPDIRECT3DDEVICE2;
  85. typedef struct IDirect3DExecuteBuffer   *LPDIRECT3DEXECUTEBUFFER;
  86. typedef struct IDirect3DLight       *LPDIRECT3DLIGHT;
  87. typedef struct IDirect3DMaterial    *LPDIRECT3DMATERIAL;
  88. typedef struct IDirect3DMaterial2   *LPDIRECT3DMATERIAL2;
  89. typedef struct IDirect3DTexture     *LPDIRECT3DTEXTURE;
  90. typedef struct IDirect3DTexture2        *LPDIRECT3DTEXTURE2;
  91. typedef struct IDirect3DViewport    *LPDIRECT3DVIEWPORT;
  92. typedef struct IDirect3DViewport2   *LPDIRECT3DVIEWPORT2;
  93.  
  94. #endif
  95.  
  96. #include "d3dtypes.h"
  97. #include "d3dcaps.h"
  98.  
  99. #ifdef __cplusplus
  100. extern "C" {
  101. #endif
  102.  
  103. /*
  104.  * IDirect3D
  105.  */
  106. #undef INTERFACE
  107. #define INTERFACE IDirect3D
  108. DECLARE_INTERFACE_(IDirect3D, IUnknown)
  109. {
  110.     /*** IUnknown methods ***/
  111.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  112.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  113.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  114.     /*** IDirect3D methods ***/
  115.     STDMETHOD(Initialize) (THIS_ REFIID) PURE;
  116.     STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
  117.     STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
  118.     STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE;
  119.     STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE;
  120.     STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
  121. };
  122.  
  123. #if !defined(__cplusplus) || defined(CINTERFACE)
  124. #define IDirect3D_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  125. #define IDirect3D_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  126. #define IDirect3D_Release(p)                      (p)->lpVtbl->Release(p)
  127. #define IDirect3D_Initialize(p, a)                (p)->lpVtbl->Initialize(p, a)
  128. #define IDirect3D_EnumDevices(p, a, b)            (p)->lpVtbl->EnumDevices(p, a, b)
  129. #define IDirect3D_CreateLight(p, a, b)            (p)->lpVtbl->CreateLight(p, a, b)
  130. #define IDirect3D_CreateMaterial(p, a, b)         (p)->lpVtbl->CreateMaterial(p, a, b)
  131. #define IDirect3D_CreateViewport(p, a, b)         (p)->lpVtbl->CreateViewport(p, a, b)
  132. #define IDirect3D_FindDevice(p, a, b)             (p)->lpVtbl->FindDevice(p, a, b)
  133. #else
  134. #define IDirect3D_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  135. #define IDirect3D_AddRef(p)                       (p)->AddRef()
  136. #define IDirect3D_Release(p)                      (p)->Release()
  137. #define IDirect3D_Initialize(p, a)                (p)->Initialize(a)
  138. #define IDirect3D_EnumDevices(p, a, b)            (p)->EnumDevices(a, b)
  139. #define IDirect3D_CreateLight(p, a, b)            (p)->CreateLight(a, b)
  140. #define IDirect3D_CreateMaterial(p, a, b)         (p)->CreateMaterial(a, b)
  141. #define IDirect3D_CreateViewport(p, a, b)         (p)->CreateViewport(a, b)
  142. #define IDirect3D_FindDevice(p, a, b)             (p)->FindDevice(a, b)
  143. #endif
  144.  
  145. /*
  146.  * IDirect3D2
  147.  */
  148. #undef INTERFACE
  149. #define INTERFACE IDirect3D2
  150. DECLARE_INTERFACE_(IDirect3D2, IUnknown)
  151. {
  152.     /*** IUnknown methods ***/
  153.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  154.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  155.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  156.     /*** IDirect3D methods ***/
  157.     STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE;
  158.     STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE;
  159.     STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL2*, IUnknown*) PURE;
  160.     STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT2*, IUnknown*) PURE;
  161.     STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;
  162.  
  163.     STDMETHOD(CreateDevice)(THIS_ REFCLSID, LPDIRECTDRAWSURFACE, LPDIRECT3DDEVICE2 *) PURE;
  164.  
  165. };
  166.  
  167. #if !defined(__cplusplus) || defined(CINTERFACE)
  168. #define IDirect3D2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  169. #define IDirect3D2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  170. #define IDirect3D2_Release(p)                      (p)->lpVtbl->Release(p)
  171. #define IDirect3D2_EnumDevices(p, a, b)            (p)->lpVtbl->EnumDevices(p, a, b)
  172. #define IDirect3D2_CreateLight(p, a, b)            (p)->lpVtbl->CreateLight(p, a, b)
  173. #define IDirect3D2_CreateMaterial(p, a, b)         (p)->lpVtbl->CreateMaterial(p, a, b)
  174. #define IDirect3D2_CreateViewport(p, a, b)         (p)->lpVtbl->CreateViewport(p, a, b)
  175. #define IDirect3D2_FindDevice(p, a, b)             (p)->lpVtbl->FindDevice(p, a, b)
  176. #define IDirect3D2_CreateDevice(p, a, b, c)        (p)->lpVtbl->CreateDevice(p, a, b, c)
  177. #else
  178. #define IDirect3D2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  179. #define IDirect3D2_AddRef(p)                       (p)->AddRef()
  180. #define IDirect3D2_Release(p)                      (p)->Release()
  181. #define IDirect3D2_EnumDevices(p, a, b)            (p)->EnumDevices(a, b)
  182. #define IDirect3D2_CreateLight(p, a, b)            (p)->CreateLight(a, b)
  183. #define IDirect3D2_CreateMaterial(p, a, b)         (p)->CreateMaterial(a, b)
  184. #define IDirect3D2_CreateViewport(p, a, b)         (p)->CreateViewport(a, b)
  185. #define IDirect3D2_FindDevice(p, a, b)             (p)->FindDevice(a, b)
  186. #define IDirect3D2_CreateDevice(p, a, b, c)        (p)->CreateDevice(a, b, c)
  187. #endif
  188.  
  189. /*
  190.  * IDirect3DDevice
  191.  */
  192. #undef INTERFACE
  193. #define INTERFACE IDirect3DDevice
  194. DECLARE_INTERFACE_(IDirect3DDevice, IUnknown)
  195. {
  196.     /*** IUnknown methods ***/
  197.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  198.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  199.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  200.     /*** IDirect3DDevice methods ***/
  201.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D, LPGUID, LPD3DDEVICEDESC) PURE;
  202.     STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
  203.     STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE) PURE;
  204.     STDMETHOD(CreateExecuteBuffer) (THIS_ LPD3DEXECUTEBUFFERDESC, LPDIRECT3DEXECUTEBUFFER*, IUnknown*) PURE;
  205.     STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
  206.     STDMETHOD(Execute) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD) PURE;
  207.     STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
  208.     STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE;
  209.     STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT, LPDIRECT3DVIEWPORT*, DWORD) PURE;
  210.     STDMETHOD(Pick) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD, LPD3DRECT) PURE;
  211.     STDMETHOD(GetPickRecords)(THIS_ LPDWORD, LPD3DPICKRECORD) PURE;
  212.     STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
  213.     STDMETHOD(CreateMatrix) (THIS_ LPD3DMATRIXHANDLE) PURE;
  214.     STDMETHOD(SetMatrix) (THIS_ D3DMATRIXHANDLE, const LPD3DMATRIX) PURE;
  215.     STDMETHOD(GetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE;
  216.     STDMETHOD(DeleteMatrix) (THIS_ D3DMATRIXHANDLE) PURE;
  217.     STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
  218.     STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
  219.     STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D*) PURE;
  220. };
  221.  
  222. #if !defined(__cplusplus) || defined(CINTERFACE)
  223. #define IDirect3DDevice_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  224. #define IDirect3DDevice_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  225. #define IDirect3DDevice_Release(p)                      (p)->lpVtbl->Release(p)
  226. #define IDirect3DDevice_Initialize(p, a, b, c)          (p)->lpVtbl->Initialize(p, a, b, c)
  227. #define IDirect3DDevice_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  228. #define IDirect3DDevice_SwapTextureHandles(p, a, b)     (p)->lpVtbl->SwapTextureHandles(p, a, b)
  229. #define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->lpVtbl->CreateExecuteBuffer(p, a, b, c)
  230. #define IDirect3DDevice_GetStats(p, a)                  (p)->lpVtbl->GetStats(p, a)
  231. #define IDirect3DDevice_Execute(p, a, b, c)             (p)->lpVtbl->Execute(p, a, b, c)
  232. #define IDirect3DDevice_AddViewport(p, a)               (p)->lpVtbl->AddViewport(p, a)
  233. #define IDirect3DDevice_DeleteViewport(p, a)            (p)->lpVtbl->DeleteViewport(p, a)
  234. #define IDirect3DDevice_NextViewport(p, a, b)           (p)->lpVtbl->NextViewport(p, a, b)
  235. #define IDirect3DDevice_Pick(p, a, b, c, d)             (p)->lpVtbl->Pick(p, a, b, c, d)
  236. #define IDirect3DDevice_GetPickRecords(p, a, b)         (p)->lpVtbl->GetPickRecords(p, a, b)
  237. #define IDirect3DDevice_EnumTextureFormats(p, a, b)     (p)->lpVtbl->EnumTextureFormats(p, a, b)
  238. #define IDirect3DDevice_CreateMatrix(p, a)              (p)->lpVtbl->CreateMatrix(p, a)
  239. #define IDirect3DDevice_SetMatrix(p, a, b)              (p)->lpVtbl->SetMatrix(p, a, b)
  240. #define IDirect3DDevice_GetMatrix(p, a, b)              (p)->lpVtbl->GetMatrix(p, a, b)
  241. #define IDirect3DDevice_DeleteMatrix(p, a)              (p)->lpVtbl->DeleteMatrix(p, a)
  242. #define IDirect3DDevice_BeginScene(p)                   (p)->lpVtbl->BeginScene(p)
  243. #define IDirect3DDevice_EndScene(p)                     (p)->lpVtbl->EndScene(p)
  244. #define IDirect3DDevice_GetDirect3D(p, a)               (p)->lpVtbl->GetDirect3D(p, a)
  245. #else
  246. #define IDirect3DDevice_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  247. #define IDirect3DDevice_AddRef(p)                       (p)->AddRef()
  248. #define IDirect3DDevice_Release(p)                      (p)->Release()
  249. #define IDirect3DDevice_Initialize(p, a, b, c)          (p)->Initialize(a, b, c)
  250. #define IDirect3DDevice_GetCaps(p, a, b)                (p)->GetCaps(a, b)
  251. #define IDirect3DDevice_SwapTextureHandles(p, a, b)     (p)->SwapTextureHandles(a, b)
  252. #define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->CreateExecuteBuffer(a, b, c)
  253. #define IDirect3DDevice_GetStats(p, a)                  (p)->GetStats(a)
  254. #define IDirect3DDevice_Execute(p, a, b, c)             (p)->Execute(a, b, c)
  255. #define IDirect3DDevice_AddViewport(p, a)               (p)->AddViewport(a)
  256. #define IDirect3DDevice_DeleteViewport(p, a)            (p)->DeleteViewport(a)
  257. #define IDirect3DDevice_NextViewport(p, a, b)           (p)->NextViewport(a, b)
  258. #define IDirect3DDevice_Pick(p, a, b, c, d)             (p)->Pick(a, b, c, d)
  259. #define IDirect3DDevice_GetPickRecords(p, a, b)         (p)->GetPickRecords(a, b)
  260. #define IDirect3DDevice_EnumTextureFormats(p, a, b)     (p)->EnumTextureFormats(a, b)
  261. #define IDirect3DDevice_CreateMatrix(p, a)              (p)->CreateMatrix(a)
  262. #define IDirect3DDevice_SetMatrix(p, a, b)              (p)->SetMatrix(a, b)
  263. #define IDirect3DDevice_GetMatrix(p, a, b)              (p)->GetMatrix(a, b)
  264. #define IDirect3DDevice_DeleteMatrix(p, a)              (p)->DeleteMatrix(a)
  265. #define IDirect3DDevice_BeginScene(p)                   (p)->BeginScene()
  266. #define IDirect3DDevice_EndScene(p)                     (p)->EndScene()
  267. #define IDirect3DDevice_GetDirect3D(p, a)               (p)->GetDirect3D(a)
  268. #endif
  269.  
  270. /*
  271.  * IDirect3DDevice2
  272.  */
  273. #undef INTERFACE
  274. #define INTERFACE IDirect3DDevice2
  275. DECLARE_INTERFACE_(IDirect3DDevice2, IUnknown)
  276. {
  277.     /*** IUnknown methods ***/
  278.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  279.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  280.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  281.     /*** IDirect3DDevice2 methods ***/
  282.     STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE;
  283.     STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE2, LPDIRECT3DTEXTURE2) PURE;
  284.     STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE;
  285.     STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
  286.     STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
  287.     STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT2, LPDIRECT3DVIEWPORT2*, DWORD) PURE;
  288.     STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE;
  289.     STDMETHOD_(HRESULT, BeginScene) (THIS) PURE;
  290.     STDMETHOD_(HRESULT, EndScene) (THIS) PURE;
  291.     STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D2*) PURE;
  292.  
  293.     /*** DrawPrimitive API ***/
  294.     STDMETHOD(SetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2) PURE;
  295.     STDMETHOD(GetCurrentViewport) (THIS_ LPDIRECT3DVIEWPORT2 *) PURE;
  296.  
  297.     STDMETHOD(SetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
  298.     STDMETHOD(GetRenderTarget) (THIS_ LPDIRECTDRAWSURFACE *) PURE;
  299.  
  300.     STDMETHOD(Begin) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, DWORD) PURE;
  301.     STDMETHOD(BeginIndexed) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
  302.     STDMETHOD(Vertex) (THIS_ LPVOID) PURE;
  303.     STDMETHOD(Index) (THIS_ WORD) PURE;
  304.     STDMETHOD(End) (THIS_ DWORD) PURE;
  305.  
  306.     STDMETHOD(GetRenderState) (THIS_ D3DRENDERSTATETYPE, LPDWORD) PURE;
  307.     STDMETHOD(SetRenderState) (THIS_ D3DRENDERSTATETYPE, DWORD) PURE;
  308.     STDMETHOD(GetLightState) (THIS_ D3DLIGHTSTATETYPE, LPDWORD) PURE;
  309.     STDMETHOD(SetLightState) (THIS_ D3DLIGHTSTATETYPE, DWORD) PURE;
  310.     STDMETHOD(SetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
  311.     STDMETHOD(GetTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
  312.     STDMETHOD(MultiplyTransform) (THIS_ D3DTRANSFORMSTATETYPE, LPD3DMATRIX) PURE;
  313.  
  314.     STDMETHOD(DrawPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, DWORD) PURE;
  315.     STDMETHOD(DrawIndexedPrimitive) (THIS_ D3DPRIMITIVETYPE, D3DVERTEXTYPE, LPVOID, DWORD, LPWORD, DWORD, DWORD) PURE;
  316.  
  317.     STDMETHOD(SetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
  318.     STDMETHOD(GetClipStatus) (THIS_ LPD3DCLIPSTATUS) PURE;
  319. };
  320.  
  321. #if !defined(__cplusplus) || defined(CINTERFACE)
  322. #define IDirect3DDevice2_QueryInterface(p, a, b)         (p)->lpVtbl->QueryInterface(p, a, b)
  323. #define IDirect3DDevice2_AddRef(p)                       (p)->lpVtbl->AddRef(p)
  324. #define IDirect3DDevice2_Release(p)                      (p)->lpVtbl->Release(p)
  325. #define IDirect3DDevice2_GetCaps(p, a, b)                (p)->lpVtbl->GetCaps(p, a, b)
  326. #define IDirect3DDevice2_SwapTextureHandles(p, a, b)     (p)->lpVtbl->SwapTextureHandles(p, a, b)
  327. #define IDirect3DDevice2_GetStats(p, a)                  (p)->lpVtbl->CreateViewport(p, a)
  328. #define IDirect3DDevice2_AddViewport(p, a)               (p)->lpVtbl->AddViewport(p, a)
  329. #define IDirect3DDevice2_DeleteViewport(p, a)            (p)->lpVtbl->DeleteViewport(p, a)
  330. #define IDirect3DDevice2_NextViewport(p, a, b)           (p)->lpVtbl->NextViewport(p, a, b)
  331. #define IDirect3DDevice2_EnumTextureFormats(p, a, b)     (p)->lpVtbl->EnumTextureFormats(p, a, b)
  332. #define IDirect3DDevice2_BeginScene(p)                   (p)->lpVtbl->BeginScene(p)
  333. #define IDirect3DDevice2_EndScene(p)                     (p)->lpVtbl->EndScene(p)
  334. #define IDirect3DDevice2_GetDirect3D(p, a)               (p)->lpVtbl->GetDirect3D(p, a)
  335.  
  336. #define IDirect3DDevice2_SetCurrentViewport(p, a)        (p)->lpVtbl->SetCurrentViewport(p, a)
  337. #define IDirect3DDevice2_GetCurrentViewport(p, a)        (p)->lpVtbl->GetCurrentViewport(p, a)
  338.  
  339. #define IDirect3DDevice2_SetRenderTarget(p, a, b)        (p)->lpVtbl->SetRenderTarget(p, a, b)
  340. #define IDirect3DDevice2_GetRenderTarget(p, a)           (p)->lpVtbl->GetRenderTarget(p, a)
  341.  
  342. #define IDirect3DDevice2_Begin(p, a, b, c)               (p)->lpVtbl->Begin(p, a, b, c)
  343. #define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e)  (p)->lpVtbl->Begin(p, a, b, c, d, e)
  344. #define IDirect3DDevice2_Vertex(p, a)                    (p)->lpVtbl->Vertex(p, a)
  345. #define IDirect3DDevice2_Index(p, a)                     (p)->lpVtbl->Index(p, a)
  346. #define IDirect3DDevice2_End(p, a)                       (p)->lpVtbl->End(p, a)
  347.  
  348. #define IDirect3DDevice2_GetRenderState(p, a, b)         (p)->lpVtbl->GetRenderState(p, a, b)
  349. #define IDirect3DDevice2_SetRenderState(p, a, b)         (p)->lpVtbl->SetRenderState(p, a, b)
  350. #define IDirect3DDevice2_GetLightState(p, a, b)          (p)->lpVtbl->GetLightState(p, a, b)
  351. #define IDirect3DDevice2_SetLightState(p, a, b)          (p)->lpVtbl->SetLightState(p, a, b)
  352. #define IDirect3DDevice2_SetTransform(p, a, b)           (p)->lpVtbl->SetTransform(p, a, b)
  353. #define IDirect3DDevice2_GetTransform(p, a, b)           (p)->lpVtbl->GetTransform(p, a, b)
  354. #define IDirect3DDevice2_MultiplyTransform(p, a, b)      (p)->lpVtbl->MultiplyTransform(p, a, b)
  355.  
  356. #define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->lpVtbl->DrawPrimitive(p, a, b, c, d, e)
  357. #define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
  358.                                                          (p)->lpVtbl->DrawIndexedPrimitive(p, a, b, c, d, e, f, g)
  359. #define IDirect3DDevice2_SetClipStatus(p, a)                 (p)->lpVtbl->SetClipStatus(p, a)
  360. #define IDirect3DDevice2_GetClipStatus(p, a)                 (p)->lpVtbl->GetClipStatus(p, a)
  361. #else
  362. #define IDirect3DDevice2_QueryInterface(p, a, b)         (p)->QueryInterface(a, b)
  363. #define IDirect3DDevice2_AddRef(p)                       (p)->AddRef()
  364. #define IDirect3DDevice2_Release(p)                      (p)->Release()
  365. #define IDirect3DDevice2_GetCaps(p, a, b)                (p)->GetCaps(a, b)
  366. #define IDirect3DDevice2_SwapTextureHandles(p, a, b)     (p)->SwapTextureHandles(a, b)
  367. #define IDirect3DDevice2_GetStats(p, a)                  (p)->CreateViewport(a)
  368. #define IDirect3DDevice2_AddViewport(p, a)               (p)->AddViewport(a)
  369. #define IDirect3DDevice2_DeleteViewport(p, a)            (p)->DeleteViewport(a)
  370. #define IDirect3DDevice2_NextViewport(p, a, b)           (p)->NextViewport(a, b)
  371. #define IDirect3DDevice2_EnumTextureFormats(p, a, b)     (p)->EnumTextureFormats(a, b)
  372. #define IDirect3DDevice2_BeginScene(p)                   (p)->BeginScene()
  373. #define IDirect3DDevice2_EndScene(p)                     (p)->EndScene()
  374. #define IDirect3DDevice2_GetDirect3D(p, a)               (p)->GetDirect3D(a)
  375.  
  376. #define IDirect3DDevice2_SetCurrentViewport(p, a)        (p)->SetCurrentViewport(a)
  377. #define IDirect3DDevice2_GetCurrentViewport(p, a)        (p)->GetCurrentViewport(a)
  378.  
  379. #define IDirect3DDevice2_SetRenderTarget(p, a, b)        (p)->SetRenderTarget(a, b)
  380. #define IDirect3DDevice2_GetRenderTarget(p, a)           (p)->GetRenderTarget(a)
  381.  
  382. #define IDirect3DDevice2_Begin(p, a, b, c)               (p)->Begin(a, b, c)
  383. #define IDirect3DDevice2_BeginIndexed(p, a, b, c, d, e)  (p)->Begin(a, b, c, d, e)
  384. #define IDirect3DDevice2_Vertex(p, a)                    (p)->Vertex(a)
  385. #define IDirect3DDevice2_Index(p, a)                     (p)->Index(a)
  386. #define IDirect3DDevice2_End(p, a)                       (p)->End(a)
  387.  
  388. #define IDirect3DDevice2_GetRenderState(p, a, b)         (p)->GetRenderState(a, b)
  389. #define IDirect3DDevice2_SetRenderState(p, a, b)         (p)->SetRenderState(a, b)
  390. #define IDirect3DDevice2_GetLightState(p, a, b)          (p)->GetLightState(a, b)
  391. #define IDirect3DDevice2_SetLightState(p, a, b)          (p)->SetLightState(a, b)
  392. #define IDirect3DDevice2_SetTransform(p, a, b)           (p)->SetTransform(a, b)
  393. #define IDirect3DDevice2_GetTransform(p, a, b)           (p)->GetTransform(a, b)
  394. #define IDirect3DDevice2_MultiplyTransform(p, a, b)      (p)->MultiplyTransform(a, b)
  395.  
  396. #define IDirect3DDevice2_DrawPrimitive(p, a, b, c, d, e) (p)->DrawPrimitive(a, b, c, d, e)
  397. #define IDirect3DDevice2_DrawIndexedPrimitive(p, a, b, c, d, e, f, g) \
  398.                                                          (p)->DrawIndexedPrimitive(a, b, c, d, e, f, g)
  399. #define IDirect3DDevice2_SetClipStatus(p, a)                             (p)->SetClipStatus(a)
  400. #define IDirect3DDevice2_GetClipStatus(p, a)                             (p)->GetClipStatus(a)
  401.  
  402. #endif
  403.  
  404. /*
  405.  * IDirect3DExecuteBuffer
  406.  */
  407. #undef INTERFACE
  408. #define INTERFACE IDirect3DExecuteBuffer
  409. DECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown)
  410. {
  411.     /*** IUnknown methods ***/
  412.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  413.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  414.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  415.     /*** IDirect3DExecuteBuffer methods ***/
  416.     STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPD3DEXECUTEBUFFERDESC) PURE;
  417.     STDMETHOD(Lock) (THIS_ LPD3DEXECUTEBUFFERDESC) PURE;
  418.     STDMETHOD_(HRESULT, Unlock) (THIS) PURE;
  419.     STDMETHOD(SetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
  420.     STDMETHOD(GetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE;
  421.     STDMETHOD(Validate) (THIS_ LPDWORD, LPD3DVALIDATECALLBACK, LPVOID, DWORD) PURE;
  422.     STDMETHOD(Optimize) (THIS_ DWORD) PURE;
  423. };
  424.  
  425. #if !defined(__cplusplus) || defined(CINTERFACE)
  426. #define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  427. #define IDirect3DExecuteBuffer_AddRef(p)               (p)->lpVtbl->AddRef(p)
  428. #define IDirect3DExecuteBuffer_Release(p)              (p)->lpVtbl->Release(p)
  429. #define IDirect3DExecuteBuffer_Initialize(p, a, b)     (p)->lpVtbl->Initialize(p, a, b)
  430. #define IDirect3DExecuteBuffer_Lock(p, a)              (p)->lpVtbl->Lock(p, a)
  431. #define IDirect3DExecuteBuffer_Unlock(p)               (p)->lpVtbl->Unlock(p)
  432. #define IDirect3DExecuteBuffer_SetExecuteData(p, a)    (p)->lpVtbl->SetExecuteData(p, a)
  433. #define IDirect3DExecuteBuffer_GetExecuteData(p, a)    (p)->lpVtbl->GetExecuteData(p, a)
  434. #define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->lpVtbl->Validate(p, a, b, c, d)
  435. #define IDirect3DExecuteBuffer_Optimize(p, a)          (p)->lpVtbl->Optimize(p, a)
  436. #else
  437. #define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  438. #define IDirect3DExecuteBuffer_AddRef(p)               (p)->AddRef()
  439. #define IDirect3DExecuteBuffer_Release(p)              (p)->Release()
  440. #define IDirect3DExecuteBuffer_Initialize(p, a, b)     (p)->Initialize(a, b)
  441. #define IDirect3DExecuteBuffer_Lock(p, a)              (p)->Lock(a)
  442. #define IDirect3DExecuteBuffer_Unlock(p)               (p)->Unlock()
  443. #define IDirect3DExecuteBuffer_SetExecuteData(p, a)    (p)->SetExecuteData(a)
  444. #define IDirect3DExecuteBuffer_GetExecuteData(p, a)    (p)->GetExecuteData(a)
  445. #define IDirect3DExecuteBuffer_Validate(p, a, b, c, d) (p)->Validate(a, b, c, d)
  446. #define IDirect3DExecuteBuffer_Optimize(p, a)          (p)->Optimize(a)
  447. #endif
  448.  
  449. /*
  450.  * IDirect3DLight
  451.  */
  452. #undef INTERFACE
  453. #define INTERFACE IDirect3DLight
  454. DECLARE_INTERFACE_(IDirect3DLight, IUnknown)
  455. {
  456.     /*** IUnknown methods ***/
  457.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  458.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  459.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  460.     /*** IDirect3DLight methods ***/
  461.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  462.     STDMETHOD(SetLight) (THIS_ LPD3DLIGHT) PURE;
  463.     STDMETHOD(GetLight) (THIS_ LPD3DLIGHT) PURE;
  464. };
  465.  
  466. #if !defined(__cplusplus) || defined(CINTERFACE)
  467. #define IDirect3DLight_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  468. #define IDirect3DLight_AddRef(p)               (p)->lpVtbl->AddRef(p)
  469. #define IDirect3DLight_Release(p)              (p)->lpVtbl->Release(p)
  470. #define IDirect3DLight_Initialize(p, a)        (p)->lpVtbl->Initialize(p, a)
  471. #define IDirect3DLight_SetLight(p, a)          (p)->lpVtbl->SetLight(p, a)
  472. #define IDirect3DLight_GetLight(p, a)          (p)->lpVtbl->GetLight(p, a)
  473. #else
  474. #define IDirect3DLight_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  475. #define IDirect3DLight_AddRef(p)               (p)->AddRef()
  476. #define IDirect3DLight_Release(p)              (p)->Release()
  477. #define IDirect3DLight_Initialize(p, a)        (p)->Initialize(a)
  478. #define IDirect3DLight_SetLight(p, a)          (p)->SetLight(a)
  479. #define IDirect3DLight_GetLight(p, a)          (p)->GetLight(a)
  480. #endif
  481.  
  482. /*
  483.  * IDirect3DMaterial
  484.  */
  485. #undef INTERFACE
  486. #define INTERFACE IDirect3DMaterial
  487. DECLARE_INTERFACE_(IDirect3DMaterial, IUnknown)
  488. {
  489.     /*** IUnknown methods ***/
  490.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  491.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  492.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  493.     /*** IDirect3DMaterial methods ***/
  494.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  495.     STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  496.     STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  497.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DMATERIALHANDLE) PURE;
  498.     STDMETHOD_(HRESULT, Reserve) (THIS) PURE;
  499.     STDMETHOD_(HRESULT, Unreserve) (THIS) PURE;
  500. };
  501.  
  502. #if !defined(__cplusplus) || defined(CINTERFACE)
  503. #define IDirect3DMaterial_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  504. #define IDirect3DMaterial_AddRef(p)               (p)->lpVtbl->AddRef(p)
  505. #define IDirect3DMaterial_Release(p)              (p)->lpVtbl->Release(p)
  506. #define IDirect3DMaterial_Initialize(p, a)        (p)->lpVtbl->Initialize(p, a)
  507. #define IDirect3DMaterial_SetMaterial(p, a)       (p)->lpVtbl->SetMaterial(p, a)
  508. #define IDirect3DMaterial_GetMaterial(p, a)       (p)->lpVtbl->GetMaterial(p, a)
  509. #define IDirect3DMaterial_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  510. #define IDirect3DMaterial_Reserve(p)              (p)->lpVtbl->Reserve(p)
  511. #define IDirect3DMaterial_Unreserve(p)            (p)->lpVtbl->Unreserve(p)
  512. #else
  513. #define IDirect3DMaterial_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  514. #define IDirect3DMaterial_AddRef(p)               (p)->AddRef()
  515. #define IDirect3DMaterial_Release(p)              (p)->Release()
  516. #define IDirect3DMaterial_Initialize(p, a)        (p)->Initialize(a)
  517. #define IDirect3DMaterial_SetMaterial(p, a)       (p)->SetMaterial(a)
  518. #define IDirect3DMaterial_GetMaterial(p, a)       (p)->GetMaterial(a)
  519. #define IDirect3DMaterial_GetHandle(p, a, b)      (p)->GetHandle(a, b)
  520. #define IDirect3DMaterial_Reserve(p)              (p)->Reserve()
  521. #define IDirect3DMaterial_Unreserve(p)            (p)->Unreserve()
  522. #endif
  523.  
  524. /*
  525.  * IDirect3DMaterial2
  526.  */
  527. #undef INTERFACE
  528. #define INTERFACE IDirect3DMaterial2
  529. DECLARE_INTERFACE_(IDirect3DMaterial2, IUnknown)
  530. {
  531.     /*** IUnknown methods ***/
  532.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  533.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  534.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  535.     /*** IDirect3DMaterial2 methods ***/
  536.     STDMETHOD(SetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  537.     STDMETHOD(GetMaterial) (THIS_ LPD3DMATERIAL) PURE;
  538.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DMATERIALHANDLE) PURE;
  539. };
  540.  
  541. #if !defined(__cplusplus) || defined(CINTERFACE)
  542. #define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  543. #define IDirect3DMaterial2_AddRef(p)               (p)->lpVtbl->AddRef(p)
  544. #define IDirect3DMaterial2_Release(p)              (p)->lpVtbl->Release(p)
  545. #define IDirect3DMaterial2_SetMaterial(p, a)       (p)->lpVtbl->SetMaterial(p, a)
  546. #define IDirect3DMaterial2_GetMaterial(p, a)       (p)->lpVtbl->GetMaterial(p, a)
  547. #define IDirect3DMaterial2_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  548. #else
  549. #define IDirect3DMaterial2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  550. #define IDirect3DMaterial2_AddRef(p)               (p)->AddRef()
  551. #define IDirect3DMaterial2_Release(p)              (p)->Release()
  552. #define IDirect3DMaterial2_SetMaterial(p, a)       (p)->SetMaterial(a)
  553. #define IDirect3DMaterial2_GetMaterial(p, a)       (p)->GetMaterial(a)
  554. #define IDirect3DMaterial2_GetHandle(p, a, b)      (p)->GetHandle(a, b)
  555. #endif
  556.  
  557. /*
  558.  * IDirect3DTexture
  559.  */
  560. #undef INTERFACE
  561. #define INTERFACE IDirect3DTexture
  562. DECLARE_INTERFACE_(IDirect3DTexture, IUnknown)
  563. {
  564.     /*** IUnknown methods ***/
  565.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  566.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  567.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  568.     /*** IDirect3DTexture methods ***/
  569.     STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPDIRECTDRAWSURFACE) PURE;
  570.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE, LPD3DTEXTUREHANDLE) PURE;
  571.     STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
  572.     STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE) PURE;
  573.     STDMETHOD_(HRESULT, Unload) (THIS) PURE;
  574. };
  575.  
  576. #if !defined(__cplusplus) || defined(CINTERFACE)
  577. #define IDirect3DTexture_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  578. #define IDirect3DTexture_AddRef(p)               (p)->lpVtbl->AddRef(p)
  579. #define IDirect3DTexture_Release(p)              (p)->lpVtbl->Release(p)
  580. #define IDirect3DTexture_Initialize(p, a, b)     (p)->lpVtbl->Initialize(p, a, b)
  581. #define IDirect3DTexture_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  582. #define IDirect3DTexture_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
  583. #define IDirect3DTexture_Load(p, a)              (p)->lpVtbl->Load(p, a)
  584. #define IDirect3DTexture_Unload(p)               (p)->lpVtbl->Unload(p)
  585. #else
  586. #define IDirect3DTexture_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  587. #define IDirect3DTexture_AddRef(p)               (p)->AddRef()
  588. #define IDirect3DTexture_Release(p)              (p)->Release()
  589. #define IDirect3DTexture_Initialize(p, a, b)     (p)->Initialize(a, b)
  590. #define IDirect3DTexture_GetHandle(p, a, b)      (p)->GetHandle(a, b)
  591. #define IDirect3DTexture_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
  592. #define IDirect3DTexture_Load(p, a)              (p)->Load(a)
  593. #define IDirect3DTexture_Unload(p)               (p)->Unload()
  594. #endif
  595.  
  596. /*
  597.  * IDirect3DTexture2
  598.  */
  599. #undef INTERFACE
  600. #define INTERFACE IDirect3DTexture2
  601. DECLARE_INTERFACE_(IDirect3DTexture2, IUnknown)
  602. {
  603.     /*** IUnknown methods ***/
  604.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  605.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  606.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  607.     /*** IDirect3DTexture2 methods ***/
  608.     STDMETHOD(GetHandle) (THIS_ LPDIRECT3DDEVICE2, LPD3DTEXTUREHANDLE) PURE;
  609.     STDMETHOD(PaletteChanged) (THIS_ DWORD, DWORD) PURE;
  610.     STDMETHOD(Load) (THIS_ LPDIRECT3DTEXTURE2) PURE;
  611. };
  612.  
  613. #if !defined(__cplusplus) || defined(CINTERFACE)
  614. #define IDirect3DTexture2_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  615. #define IDirect3DTexture2_AddRef(p)               (p)->lpVtbl->AddRef(p)
  616. #define IDirect3DTexture2_Release(p)              (p)->lpVtbl->Release(p)
  617. #define IDirect3DTexture2_GetHandle(p, a, b)      (p)->lpVtbl->GetHandle(p, a, b)
  618. #define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->lpVtbl->PaletteChanged(p, a, b)
  619. #define IDirect3DTexture2_Load(p, a)              (p)->lpVtbl->Load(p, a)
  620. #else
  621. #define IDirect3DTexture2_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  622. #define IDirect3DTexture2_AddRef(p)               (p)->AddRef()
  623. #define IDirect3DTexture2_Release(p)              (p)->Release()
  624. #define IDirect3DTexture2_GetHandle(p, a, b)      (p)->GetHandle(a, b)
  625. #define IDirect3DTexture2_PaletteChanged(p, a, b) (p)->PaletteChanged(a, b)
  626. #define IDirect3DTexture2_Load(p, a)              (p)->Load(a)
  627. #endif
  628.  
  629. /* 
  630.  * IDirect3DViewport
  631.  */
  632. #undef INTERFACE
  633. #define INTERFACE IDirect3DViewport
  634. DECLARE_INTERFACE_(IDirect3DViewport, IUnknown)
  635. {
  636.     /*** IUnknown methods ***/
  637.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  638.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  639.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  640.     /*** IDirect3DViewport methods ***/
  641.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  642.     STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  643.     STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  644.     STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
  645.     STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
  646.     STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
  647.     STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
  648.     STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
  649.     STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
  650.     STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
  651.     STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  652.     STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  653.     STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
  654. };
  655.  
  656. #if !defined(__cplusplus) || defined(CINTERFACE)
  657. #define IDirect3DViewport_QueryInterface(p, a, b)          (p)->lpVtbl->QueryInterface(p, a, b)
  658. #define IDirect3DViewport_AddRef(p)                        (p)->lpVtbl->AddRef(p)
  659. #define IDirect3DViewport_Release(p)                       (p)->lpVtbl->Release(p)
  660. #define IDirect3DViewport_Initialize(p, a)                 (p)->lpVtbl->Initialize(p, a)
  661. #define IDirect3DViewport_GetViewport(p, a)                (p)->lpVtbl->GetViewport(p, a)
  662. #define IDirect3DViewport_SetViewport(p, a)                (p)->lpVtbl->SetViewport(p, a)
  663. #define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
  664. #define IDirect3DViewport_LightElements(p, a, b)           (p)->lpVtbl->LightElements(p, a, b)
  665. #define IDirect3DViewport_SetBackground(p, a)              (p)->lpVtbl->SetBackground(p, a)
  666. #define IDirect3DViewport_GetBackground(p, a, b)           (p)->lpVtbl->GetBackground(p, a, b)
  667. #define IDirect3DViewport_SetBackgroundDepth(p, a)         (p)->lpVtbl->SetBackgroundDepth(p, a)
  668. #define IDirect3DViewport_GetBackgroundDepth(p, a, b)      (p)->lpVtbl->GetBackgroundDepth(p, a, b)
  669. #define IDirect3DViewport_Clear(p, a, b, c)                (p)->lpVtbl->Clear(p, a, b, c)
  670. #define IDirect3DViewport_AddLight(p, a)                   (p)->lpVtbl->AddLight(p, a)
  671. #define IDirect3DViewport_DeleteLight(p, a)                (p)->lpVtbl->DeleteLight(p, a)
  672. #define IDirect3DViewport_NextLight(p, a, b, c)            (p)->lpVtbl->NextLight(p, a, b, c)
  673. #else
  674. #define IDirect3DViewport_QueryInterface(p, a, b)          (p)->QueryInterface(a, b)
  675. #define IDirect3DViewport_AddRef(p)                        (p)->AddRef()
  676. #define IDirect3DViewport_Release(p)                       (p)->Release()
  677. #define IDirect3DViewport_Initialize(p, a)                 (p)->Initialize(a)
  678. #define IDirect3DViewport_GetViewport(p, a)                (p)->GetViewport(a)
  679. #define IDirect3DViewport_SetViewport(p, a)                (p)->SetViewport(a)
  680. #define IDirect3DViewport_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
  681. #define IDirect3DViewport_LightElements(p, a, b)           (p)->LightElements(a, b)
  682. #define IDirect3DViewport_SetBackground(p, a)              (p)->SetBackground(a)
  683. #define IDirect3DViewport_GetBackground(p, a, b)           (p)->GetBackground(a, b)
  684. #define IDirect3DViewport_SetBackgroundDepth(p, a)         (p)->SetBackgroundDepth(a)
  685. #define IDirect3DViewport_GetBackgroundDepth(p, a, b)      (p)->GetBackgroundDepth(a, b)
  686. #define IDirect3DViewport_Clear(p, a, b, c)                (p)->Clear(a, b, c)
  687. #define IDirect3DViewport_AddLight(p, a)                   (p)->AddLight(a)
  688. #define IDirect3DViewport_DeleteLight(p, a)                (p)->DeleteLight(a)
  689. #define IDirect3DViewport_NextLight(p, a, b, c)            (p)->NextLight(a, b, c)
  690. #endif
  691.  
  692. /*
  693.  * IDirect3DViewport2
  694.  */
  695. #undef INTERFACE
  696. #define INTERFACE IDirect3DViewport2
  697. DECLARE_INTERFACE_(IDirect3DViewport2, IDirect3DViewport)
  698. {
  699.     /*** IUnknown methods ***/
  700.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE;
  701.     STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  702.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  703.     /*** IDirect3DViewport methods ***/
  704.     STDMETHOD(Initialize) (THIS_ LPDIRECT3D) PURE;
  705.     STDMETHOD(GetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  706.     STDMETHOD(SetViewport) (THIS_ LPD3DVIEWPORT) PURE;
  707.     STDMETHOD(TransformVertices) (THIS_ DWORD, LPD3DTRANSFORMDATA, DWORD, LPDWORD) PURE;
  708.     STDMETHOD(LightElements) (THIS_ DWORD, LPD3DLIGHTDATA) PURE;
  709.     STDMETHOD(SetBackground) (THIS_ D3DMATERIALHANDLE) PURE;
  710.     STDMETHOD(GetBackground) (THIS_ LPD3DMATERIALHANDLE, LPBOOL) PURE;
  711.     STDMETHOD(SetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE) PURE;
  712.     STDMETHOD(GetBackgroundDepth) (THIS_ LPDIRECTDRAWSURFACE*, LPBOOL) PURE;
  713.     STDMETHOD(Clear) (THIS_ DWORD, LPD3DRECT, DWORD) PURE;
  714.     STDMETHOD(AddLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  715.     STDMETHOD(DeleteLight) (THIS_ LPDIRECT3DLIGHT) PURE;
  716.     STDMETHOD(NextLight) (THIS_ LPDIRECT3DLIGHT, LPDIRECT3DLIGHT*, DWORD) PURE;
  717.     /*** IDirect3DViewport2 methods ***/
  718.     STDMETHOD(GetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
  719.     STDMETHOD(SetViewport2) (THIS_ LPD3DVIEWPORT2) PURE;
  720. };
  721.  
  722. #if !defined(__cplusplus) || defined(CINTERFACE)
  723. #define IDirect3DViewport2_QueryInterface(p, a, b)          (p)->lpVtbl->QueryInterface(p, a, b)
  724. #define IDirect3DViewport2_AddRef(p)                        (p)->lpVtbl->AddRef(p)
  725. #define IDirect3DViewport2_Release(p)                       (p)->lpVtbl->Release(p)
  726. #define IDirect3DViewport2_Initialize(p, a)                 (p)->lpVtbl->Initialize(p, a)
  727. #define IDirect3DViewport2_GetViewport(p, a)                (p)->lpVtbl->GetViewport(p, a)
  728. #define IDirect3DViewport2_SetViewport(p, a)                (p)->lpVtbl->SetViewport(p, a)
  729. #define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->lpVtbl->TransformVertices(p, a, b, c, d)
  730. #define IDirect3DViewport2_LightElements(p, a, b)           (p)->lpVtbl->LightElements(p, a, b)
  731. #define IDirect3DViewport2_SetBackground(p, a)              (p)->lpVtbl->SetBackground(p, a)
  732. #define IDirect3DViewport2_GetBackground(p, a, b)           (p)->lpVtbl->GetBackground(p, a, b)
  733. #define IDirect3DViewport2_SetBackgroundDepth(p, a)         (p)->lpVtbl->SetBackgroundDepth(p, a)
  734. #define IDirect3DViewport2_GetBackgroundDepth(p, a, b)      (p)->lpVtbl->GetBackgroundDepth(p, a, b)
  735. #define IDirect3DViewport2_Clear(p, a, b, c)                (p)->lpVtbl->Clear(p, a, b, c)
  736. #define IDirect3DViewport2_AddLight(p, a)                   (p)->lpVtbl->AddLight(p, a)
  737. #define IDirect3DViewport2_DeleteLight(p, a)                (p)->lpVtbl->DeleteLight(p, a)
  738. #define IDirect3DViewport2_NextLight(p, a, b, c)            (p)->lpVtbl->NextLight(p, a, b, c)
  739. #define IDirect3DViewport2_GetViewport2(p, a)                (p)->lpVtbl->GetViewport2(p, a)
  740. #define IDirect3DViewport2_SetViewport2(p, a)                (p)->lpVtbl->SetViewport2(p, a)
  741. #else
  742. #define IDirect3DViewport2_QueryInterface(p, a, b)          (p)->QueryInterface(a, b)
  743. #define IDirect3DViewport2_AddRef(p)                        (p)->AddRef()
  744. #define IDirect3DViewport2_Release(p)                       (p)->Release()
  745. #define IDirect3DViewport2_Initialize(p, a)                 (p)->Initialize(a)
  746. #define IDirect3DViewport2_GetViewport(p, a)                (p)->GetViewport(a)
  747. #define IDirect3DViewport2_SetViewport(p, a)                (p)->SetViewport(a)
  748. #define IDirect3DViewport2_TransformVertices(p, a, b, c, d) (p)->TransformVertices(a, b, c, d)
  749. #define IDirect3DViewport2_LightElements(p, a, b)           (p)->LightElements(a, b)
  750. #define IDirect3DViewport2_SetBackground(p, a)              (p)->SetBackground(a)
  751. #define IDirect3DViewport2_GetBackground(p, a, b)           (p)->GetBackground(a, b)
  752. #define IDirect3DViewport2_SetBackgroundDepth(p, a)         (p)->SetBackgroundDepth(a)
  753. #define IDirect3DViewport2_GetBackgroundDepth(p, a, b)      (p)->GetBackgroundDepth(a, b)
  754. #define IDirect3DViewport2_Clear(p, a, b, c)                (p)->Clear(a, b, c)
  755. #define IDirect3DViewport2_AddLight(p, a)                   (p)->AddLight(a)
  756. #define IDirect3DViewport2_DeleteLight(p, a)                (p)->DeleteLight(a)
  757. #define IDirect3DViewport2_NextLight(p, a, b, c)            (p)->NextLight(a, b, c)
  758. #define IDirect3DViewport2_GetViewport2(p, a)                (p)->GetViewport2(a)
  759. #define IDirect3DViewport2_SetViewport2(p, a)                (p)->SetViewport2(a)
  760. #endif
  761.  
  762.  
  763. /****************************************************************************
  764.  *
  765.  * Flags for IDirect3DDevice::NextViewport
  766.  *
  767.  ****************************************************************************/
  768.  
  769. /*
  770.  * Return the next viewport
  771.  */
  772. #define D3DNEXT_NEXT    0x00000001l
  773.  
  774. /*
  775.  * Return the first viewport
  776.  */
  777. #define D3DNEXT_HEAD    0x00000002l
  778.  
  779. /*
  780.  * Return the last viewport
  781.  */
  782. #define D3DNEXT_TAIL    0x00000004l
  783.  
  784.  
  785. /****************************************************************************
  786.  *
  787.  * Flags for DrawPrimitive/DrawIndexedPrimitive
  788.  *   Also valid for Begin/BeginIndexed
  789.  *
  790.  ****************************************************************************/
  791.  
  792. /*
  793.  * Wait until the device is ready to draw the primitive
  794.  * This will cause DP to not return DDERR_WASSTILLDRAWING
  795.  */
  796. #define D3DDP_WAIT              0x00000001l
  797.  
  798. /*
  799.  * Hint that the primitives have been clipped by the application.
  800.  */
  801. #define D3DDP_DONOTCLIP         0x00000004l
  802.  
  803. /*
  804.  * Hint that the extents need not be updated.
  805.  */
  806. #define D3DDP_DONOTUPDATEEXTENTS    0x00000008l
  807.  
  808. /*
  809.  * Direct3D Errors
  810.  * DirectDraw error codes are used when errors not specified here.
  811.  */
  812. #define D3D_OK              DD_OK
  813. #define D3DERR_BADMAJORVERSION      MAKE_DDHRESULT(700)
  814. #define D3DERR_BADMINORVERSION      MAKE_DDHRESULT(701)
  815.  
  816. /*
  817.  * An invalid device was requested by the application.
  818.  */
  819. #define D3DERR_INVALID_DEVICE   MAKE_DDHRESULT(705)
  820. #define D3DERR_INITFAILED       MAKE_DDHRESULT(706)
  821.  
  822. /*
  823.  * SetRenderTarget attempted on a device that was
  824.  * QI'd off the render target.
  825.  */
  826. #define D3DERR_DEVICEAGGREGATED MAKE_DDHRESULT(707)
  827.  
  828. #define D3DERR_EXECUTE_CREATE_FAILED    MAKE_DDHRESULT(710)
  829. #define D3DERR_EXECUTE_DESTROY_FAILED   MAKE_DDHRESULT(711)
  830. #define D3DERR_EXECUTE_LOCK_FAILED  MAKE_DDHRESULT(712)
  831. #define D3DERR_EXECUTE_UNLOCK_FAILED    MAKE_DDHRESULT(713)
  832. #define D3DERR_EXECUTE_LOCKED       MAKE_DDHRESULT(714)
  833. #define D3DERR_EXECUTE_NOT_LOCKED   MAKE_DDHRESULT(715)
  834.  
  835. #define D3DERR_EXECUTE_FAILED       MAKE_DDHRESULT(716)
  836. #define D3DERR_EXECUTE_CLIPPED_FAILED   MAKE_DDHRESULT(717)
  837.  
  838. #define D3DERR_TEXTURE_NO_SUPPORT   MAKE_DDHRESULT(720)
  839. #define D3DERR_TEXTURE_CREATE_FAILED    MAKE_DDHRESULT(721)
  840. #define D3DERR_TEXTURE_DESTROY_FAILED   MAKE_DDHRESULT(722)
  841. #define D3DERR_TEXTURE_LOCK_FAILED  MAKE_DDHRESULT(723)
  842. #define D3DERR_TEXTURE_UNLOCK_FAILED    MAKE_DDHRESULT(724)
  843. #define D3DERR_TEXTURE_LOAD_FAILED  MAKE_DDHRESULT(725)
  844. #define D3DERR_TEXTURE_SWAP_FAILED  MAKE_DDHRESULT(726)
  845. #define D3DERR_TEXTURE_LOCKED       MAKE_DDHRESULT(727)
  846. #define D3DERR_TEXTURE_NOT_LOCKED   MAKE_DDHRESULT(728)
  847. #define D3DERR_TEXTURE_GETSURF_FAILED   MAKE_DDHRESULT(729)
  848.  
  849. #define D3DERR_MATRIX_CREATE_FAILED MAKE_DDHRESULT(730)
  850. #define D3DERR_MATRIX_DESTROY_FAILED    MAKE_DDHRESULT(731)
  851. #define D3DERR_MATRIX_SETDATA_FAILED    MAKE_DDHRESULT(732)
  852. #define D3DERR_MATRIX_GETDATA_FAILED    MAKE_DDHRESULT(733)
  853. #define D3DERR_SETVIEWPORTDATA_FAILED   MAKE_DDHRESULT(734)
  854.  
  855. #define D3DERR_INVALIDCURRENTVIEWPORT   MAKE_DDHRESULT(735)
  856. #define D3DERR_INVALIDPRIMITIVETYPE     MAKE_DDHRESULT(736)
  857. #define D3DERR_INVALIDVERTEXTYPE        MAKE_DDHRESULT(737)
  858. #define D3DERR_TEXTURE_BADSIZE          MAKE_DDHRESULT(738)
  859. #define D3DERR_INVALIDRAMPTEXTURE       MAKE_DDHRESULT(739)
  860.  
  861. #define D3DERR_MATERIAL_CREATE_FAILED   MAKE_DDHRESULT(740)
  862. #define D3DERR_MATERIAL_DESTROY_FAILED  MAKE_DDHRESULT(741)
  863. #define D3DERR_MATERIAL_SETDATA_FAILED  MAKE_DDHRESULT(742)
  864. #define D3DERR_MATERIAL_GETDATA_FAILED  MAKE_DDHRESULT(743)
  865. #define D3DERR_INVALIDPALETTE           MAKE_DDHRESULT(744)
  866.  
  867. #define D3DERR_ZBUFF_NEEDS_SYSTEMMEMORY MAKE_DDHRESULT(745)
  868. #define D3DERR_ZBUFF_NEEDS_VIDEOMEMORY  MAKE_DDHRESULT(746)
  869. #define D3DERR_SURFACENOTINVIDMEM       MAKE_DDHRESULT(747)
  870.  
  871. #define D3DERR_LIGHT_SET_FAILED     MAKE_DDHRESULT(750)
  872. #define D3DERR_LIGHTHASVIEWPORT     MAKE_DDHRESULT(751)
  873. #define D3DERR_LIGHTNOTINTHISVIEWPORT           MAKE_DDHRESULT(752)
  874.  
  875. #define D3DERR_SCENE_IN_SCENE       MAKE_DDHRESULT(760)
  876. #define D3DERR_SCENE_NOT_IN_SCENE   MAKE_DDHRESULT(761)
  877. #define D3DERR_SCENE_BEGIN_FAILED   MAKE_DDHRESULT(762)
  878. #define D3DERR_SCENE_END_FAILED     MAKE_DDHRESULT(763)
  879.  
  880. #define D3DERR_INBEGIN                  MAKE_DDHRESULT(770)
  881. #define D3DERR_NOTINBEGIN               MAKE_DDHRESULT(771)
  882. #define D3DERR_NOVIEWPORTS              MAKE_DDHRESULT(772)
  883. #define D3DERR_VIEWPORTDATANOTSET       MAKE_DDHRESULT(773)
  884. #define D3DERR_VIEWPORTHASNODEVICE      MAKE_DDHRESULT(774)
  885. #define D3DERR_NOCURRENTVIEWPORT        MAKE_DDHRESULT(775)
  886.  
  887. #ifdef __cplusplus
  888. };
  889. #endif
  890.  
  891. #endif /* _D3D_H_ */
  892.